.class public Lcom/adwo/adsdk/V;
.super Ljava/lang/Object;
.source "SourceFile"


# instance fields
.field protected final a:Landroid/view/View;

.field final b:Landroid/widget/PopupWindow;

.field c:Landroid/view/View;

.field private d:Landroid/graphics/drawable/Drawable;

.field private final e:Landroid/view/WindowManager;


# direct methods
.method public constructor <init>(Landroid/view/View;)V
    .locals 2
    .parameter

    .prologue
    .line 29
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 20
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/adwo/adsdk/V;->d:Landroid/graphics/drawable/Drawable;

    .line 30
    iput-object p1, p0, Lcom/adwo/adsdk/V;->a:Landroid/view/View;

    .line 31
    new-instance v0, Landroid/widget/PopupWindow;

    invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/PopupWindow;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    .line 35
    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    new-instance v1, Lcom/adwo/adsdk/W;

    invoke-direct {v1, p0}, Lcom/adwo/adsdk/W;-><init>(Lcom/adwo/adsdk/V;)V

    invoke-virtual {v0, v1}, Landroid/widget/PopupWindow;->setTouchInterceptor(Landroid/view/View$OnTouchListener;)V

    .line 46
    iget-object v0, p0, Lcom/adwo/adsdk/V;->a:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 47
    const-string v1, "window"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    .line 46
    iput-object v0, p0, Lcom/adwo/adsdk/V;->e:Landroid/view/WindowManager;

    .line 48
    invoke-virtual {p0}, Lcom/adwo/adsdk/V;->b()V

    .line 50
    return-void
.end method


# virtual methods
.method public final a(Z)V
    .locals 10
    .parameter

    .prologue
    const v9, 0x7f060002

    const/4 v8, 0x0

    const/4 v7, -0x2

    const/4 v6, 0x1

    .line 130
    iget-object v0, p0, Lcom/adwo/adsdk/V;->c:Landroid/view/View;

    if-nez v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "setContentView was not called with a view to display."

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    new-instance v1, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v1}, Landroid/graphics/drawable/BitmapDrawable;-><init>()V

    invoke-virtual {v0, v1}, Landroid/widget/PopupWindow;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v0, v7}, Landroid/widget/PopupWindow;->setWidth(I)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v0, v7}, Landroid/widget/PopupWindow;->setHeight(I)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v0, v6}, Landroid/widget/PopupWindow;->setTouchable(Z)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v0, v6}, Landroid/widget/PopupWindow;->setFocusable(Z)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v0, v6}, Landroid/widget/PopupWindow;->setOutsideTouchable(Z)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    iget-object v1, p0, Lcom/adwo/adsdk/V;->c:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/PopupWindow;->setContentView(Landroid/view/View;)V

    if-eqz p1, :cond_1

    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v0, v9}, Landroid/widget/PopupWindow;->setAnimationStyle(I)V

    :goto_0
    const/4 v0, 0x2

    new-array v0, v0, [I

    iget-object v1, p0, Lcom/adwo/adsdk/V;->a:Landroid/view/View;

    invoke-virtual {v1, v0}, Landroid/view/View;->getLocationOnScreen([I)V

    new-instance v1, Landroid/graphics/Rect;

    aget v2, v0, v8

    aget v3, v0, v6

    aget v4, v0, v8

    iget-object v5, p0, Lcom/adwo/adsdk/V;->a:Landroid/view/View;

    invoke-virtual {v5}, Landroid/view/View;->getWidth()I

    move-result v5

    add-int/2addr v4, v5

    aget v0, v0, v6

    iget-object v5, p0, Lcom/adwo/adsdk/V;->a:Landroid/view/View;

    invoke-virtual {v5}, Landroid/view/View;->getHeight()I

    move-result v5

    add-int/2addr v0, v5

    invoke-direct {v1, v2, v3, v4, v0}, Landroid/graphics/Rect;-><init>(IIII)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->c:Landroid/view/View;

    invoke-virtual {v0, v7, v7}, Landroid/view/View;->measure(II)V

    iget-object v0, p0, Lcom/adwo/adsdk/V;->c:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredWidth()I

    move-result v0

    iget-object v2, p0, Lcom/adwo/adsdk/V;->c:Landroid/view/View;

    invoke-virtual {v2}, Landroid/view/View;->getMeasuredHeight()I

    move-result v2

    iget-object v3, p0, Lcom/adwo/adsdk/V;->e:Landroid/view/WindowManager;

    invoke-interface {v3}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v3

    invoke-virtual {v3}, Landroid/view/Display;->getWidth()I

    move-result v3

    iget-object v4, p0, Lcom/adwo/adsdk/V;->e:Landroid/view/WindowManager;

    invoke-interface {v4}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v4

    invoke-virtual {v4}, Landroid/view/Display;->getHeight()I

    sub-int v0, v3, v0

    div-int/lit8 v0, v0, 0x2

    add-int/lit8 v0, v0, 0x0

    iget v3, v1, Landroid/graphics/Rect;->top:I

    sub-int/2addr v3, v2

    add-int/lit8 v3, v3, 0x0

    iget v4, v1, Landroid/graphics/Rect;->top:I

    if-le v2, v4, :cond_2

    iget v1, v1, Landroid/graphics/Rect;->bottom:I

    add-int/lit8 v1, v1, 0x0

    iget-object v2, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    invoke-virtual {v2, v9}, Landroid/widget/PopupWindow;->setAnimationStyle(I)V

    :goto_1
    iget-object v2, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    iget-object v3, p0, Lcom/adwo/adsdk/V;->a:Landroid/view/View;

    invoke-virtual {v2, v3, v8, v0, v1}, Landroid/widget/PopupWindow;->showAtLocation(Landroid/view/View;III)V

    .line 131
    return-void

    .line 130
    :cond_1
    iget-object v0, p0, Lcom/adwo/adsdk/V;->b:Landroid/widget/PopupWindow;

    const v1, 0x7f060001

    invoke-virtual {v0, v1}, Landroid/widget/PopupWindow;->setAnimationStyle(I)V

    goto :goto_0

    :cond_2
    move v1, v3

    goto :goto_1
.end method

.method protected b()V
    .locals 0

    .prologue
    .line 57
    return-void
.end method
